package com.open.capacity.exam.feign;

import com.open.capacity.common.constant.ServiceNameConstant;
import com.open.capacity.common.feign.FeignExceptionConfig;
import com.open.capacity.common.model.Group;
import com.open.capacity.common.model.SysUser;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.exam.feign.impl.GroupFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = ServiceNameConstant.USER, configuration = FeignExceptionConfig.class, fallback = GroupFeignFallBack.class, decode404 = true)
public interface GroupFeignClient {
    /**
     * 通过小组id，查询小组成员
     * @param params
     * @return
     */
    @PostMapping("/group/selectUserByGroup")
    PageResult<SysUser> selectUserByGroup(@RequestParam("params") Map<String,Object> params);
    /**
     * 获取教师管理的小组
     * @param params
     * @return
     */
    @PostMapping("/group/getGroupByTeacher")
    PageResult<Group> getGroupByTeacher(@RequestParam("params") Map<String,Object> params);
}
